//
// Created by hsj on 2022/1/12.
//
#include <iostream>
#include "t_class.h"

//测试类class
void my_class_hsj::test_class(){
//    my_class_hsj::StockSub fluffy_the_cat;//一般在栈空间（自动存储）,默认构造函数
//    fluffy_the_cat.acquire("NanoSmart",20,12.50);
//    fluffy_the_cat.show();
//    fluffy_the_cat.buy(15,18.125);
//    fluffy_the_cat.show();
//    fluffy_the_cat.sell(400,20.00);
//    fluffy_the_cat.show();
//    fluffy_the_cat.buy(300000,40.125);
//    fluffy_the_cat.show();
//    fluffy_the_cat.sell(300000,0.125);
//    fluffy_the_cat.show();
    //结束
//    fluffy_the_cat.s_end();

    //多态-普通
//    my_class_hsj_other::TestPolymorphic tp;
//    tp.test_class_polymorphic_rf(fluffy_the_cat);
    //多态-heap（指针）
//    my_class_hsj::Stock *fluffy_the_cat_sub_heap = new my_class_hsj::StockSub;//默认构造函数
//    tp.test_class_polymorphic_pointer(fluffy_the_cat_sub_heap);
//    delete fluffy_the_cat_sub_heap;


//    my_class_hsj::StockSub fluffy_the_cat;//一般在栈空间（自动存储）,默认构造函数
//    fluffy_the_cat.show();
//    my_class_hsj::StockSub fluffy_the_cat001("NanoSmart",20,12.50);//一般在栈空间（自动存储）,参数构造函数
//    fluffy_the_cat001.show();
//    my_class_hsj::StockSub fluffy_the_cat002 = my_class_hsj::StockSub("NanoSmart",20,12.50);//一般在栈空间（自动存储）,参数构造函数
//    fluffy_the_cat002.show();

//    my_class_hsj::StockSub *fluffy_the_cat_pointer = new my_class_hsj::StockSub;
//    fluffy_the_cat_pointer->show();
//    (*fluffy_the_cat_pointer).show();
//    delete fluffy_the_cat_pointer;

      //c++11
//      my_class_hsj::StockSub fluffy_the_cat003{"NanoSmart"};
//      fluffy_the_cat003.show();

//      C++11
//      const 方式错误使用，正确使用见：StockSub class,->说明不会修改当前类实例对象
//      const my_class_hsj::StockSub fluffy_the_cat004 = {"NanoSmart"};
//      fluffy_the_cat004.show();

//        my_class_hsj::Stock fluffy_the_cat001 = my_class_hsj::Stock("NanoSmart001",10,12.50);
//        my_class_hsj::Stock fluffy_the_cat002 = my_class_hsj::Stock("NanoSmart002",20,22.50);
//        my_class_hsj::Stock fluffy_the_cat_what_001_002 = fluffy_the_cat001.topValue(fluffy_the_cat002);
//        fluffy_the_cat_what_001_002.show();

         //枚举、常量
         my_class_hsj::Stock fluffy_the_cat_enum_const = my_class_hsj::Stock("NanoSmart_enum_const",110,112.50);
         fluffy_the_cat_enum_const.show_enum_const();
}
